1. Technical Field
The present invention relates in general to testing of applets or applications in a data processing system and in particular to repeated testing of a single applet or consolidated testing of multiple applets. Still more particularly, the present invention relates to automatically and repeatedly running applets in fresh native or non-native runtime environments each time.
2. Description of the Related Art
Java applets are Java programs which may be included in HyperText Markup Language (HTML) pages, much in the same manner that images may be included in such pages. The  less than APPLET greater than  tag definition of HTML is employed to identify Java applets. When a Java-compatible browser is utilized to view such a page, the applet""s code is transferred to the system on which the browser is executing and is executed either by the browser or by another Java runtime environment within the system.
Since they typically run in web browsers and require user intervention to run and interpret results, Java applets present a difficult testing challenge. Generally, testers must manually load the HTML page including the applet reference. If the applet is oriented toward user inter-action, the results may be viewed or otherwise determined by the tester. However, many applets do not require user interaction or generate visible output. For example, an applet may merely create several class instances and run methods against those instances. The success or failure of each method could not be determined without a tool permitting examination of the target class instances.
Additionally, designers may wish to repetitively load and run an applet during testing to verify proper operation over a target number of executions. Some tools, such as JavaScript, provide an automatic mechanism for reloading HTML pages (which could contain a Java applet). With such tools, however, after the first execution the applet will not normally be reloaded and run with a clean Java Runtime Environment (JRE). Nor can developers/testers change the source of the page after the first reload within such tools, or specify a list of pages to be repetitively reloaded. This requires developers/testers to have multiple web browsers running for each discrete page containing the applet or applets being tested, as well as for each reload of a single page.
Users of personal digital assistants (PDAs)xe2x80x94also referred to as personal communications assistants (PCAs) or tier-0 data processing systems and including, for example, the Palm series (Palm Pilot, Palm III, etc.) available from 3Com Corporationxe2x80x94are faced with a similar situation. Users may need to repeatedly run an applet within a PDA web browser application in a mobile environment. For instance, a meteorologist may need to access data from weather monitor applets on a periodic basis. However, applets may set system properties which can only be cleared with a new invocation of the web browser. New executions of the web browser may be required to run the applet with a fresh JRE on a repetitive basis.
It would be desirable, therefore, to provide a mechanism for testing or running applets which permits repetitive execution of an applet with a fresh runtime environment for each execution. It would further be advantageous for the mechanism to automatically permit consecutive testing of applets from different sources (HTML pages) or different web browsers, and to provide some tangible indication of the success or failure of methods within applets being tested or run.
It is therefore one object of the present invention to provide an improved method, apparatus, and computer program product for testing of applets or applications in a data processing system.
It is another object of the present invention to provide an improved method, apparatus, and computer program product for repeated testing of a single applet or consolidated testing of multiple applets.
It is yet another object of the present invention to provide a method, apparatus, or computer program product for automatically and repeatedly running applet in fresh native or non-native runtime environments each time.
The foregoing objects are achieved as is now described. A test/run program receives as input a list of identifiers for source pages referencing applets to be tested or run. The test/run program creates an array of the identifiers, together with parameters for each identifier, web browser to run the test under, and a number of times the source page is to be reloaded and the applets re-run. For each source page, and for each reload of a given source page, the test/run program starts the specified web browser process, loads the designated source page, and starts a fresh runtime environment for the applet. Support for a test class within the test/run program allows the applets to write success, failure, or informational results to an output file and to exit the web browser process when complete. Where a native implementation of the test class is employed, special security permissions need not be specified and the test/run program need not necessarily be run locally. In exiting the web browser process, the applets write a marker file to indicate that the applet run is complete, which the test/run program detects. Multiple applets may be automatically and repetitively loaded, each with a fresh runtime environment in a new web browser application, for testing of the applets or repeat execution of the applets changing system properties.
The above as well as additional objects, features, and advantages of the present invention will become apparent in the following detailed written description.